// Learn TypeScript:
//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/typescript.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/life-cycle-callbacks.html

import XYAtlas from "./XYAtlas";

const {ccclass, property} = cc._decorator;

@ccclass
export default class XYSprite extends cc.Sprite {


    protected onLoad() {
        if (this.spriteFrame) {
            //@ts-ignore
            let tx = XYAtlas.ins.getTexture(this.spriteFrame._uuid);
            if (tx) {
                this.spriteFrame.setTexture(tx.texture, tx.frame);
            }
        }
    }

    // update (dt) {}
}
